<%@ page language="java"  pageEncoding="utf-8"%>
<%@ page import="com.jsp.handlers.CountFileHandler" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>count page</title>
  </head>
  <body>
    <%
    	long count = CountFileHandler.readFile(request.getRealPath("/")+"count.txt");
    	if(session.getAttribute("visited")==null){
	    	session.setAttribute("visited","y");
	    	session.setMaxInactiveInterval(60*60*24);
	    	count=count+1;
    	}
    	
    	CountFileHandler.writeFile(request.getRealPath("/")+"count.txt",count);
    	
    %>
    该页被访问过<%=CountFileHandler.transform(count) %>次
</body>
</html>
